﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Common;
using System.Data;

namespace MNF.DataAccess.SysHelper
{
    /// <summary>
    /// added by lqm 20130707 系统用户业务处理
    /// </summary>
    public static class UsersHelper
    {
        /// <summary>
        /// 用户登录信息与数据库中信息的校验
        /// </summary>
        private const string Sql_Login = @"select count(*) from Sys_Users where SUNo=@SUNo and SUPassword=@SUPassword";
        public static bool Login(string SUNo, string SUPassword)
        {
            DbParameter[] Params = { 
                                        DBHelper.MakeInParam("@SUNo", DbType.String,SUNo),
                                        DBHelper.MakeInParam("@SUPassword", DbType.String,SUPassword),
                                   };
            int count = (int)DBHelper.ExecuteScalar(CommandType.Text, Sql_Login, Params);
            return (count > 0);
        }
    }
}
